package Uebung01;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;


public class KartenVorgabe {
    
    public static final char MUD = 'M';
    public static final char EMPTY = '0';
    public static final char KEY = 'k';
    public static final char DOOR = 'd';
    public static final char YOU = '*';
    public static final char WALL = '#';

    public static final char[][] getMap(String file) throws IOException {
	BufferedReader reader = new BufferedReader(new FileReader(file));
	
	// Header: Width x Height
	String header = reader.readLine();
	String size[] = header.split("x");
	int width = Integer.valueOf(size[0].trim());
	int height = Integer.valueOf(size[1].trim());
	// Read map
	char map[][] = new char[height][width];
	for(int i = 0; i < height; i++) {
	    String line = reader.readLine();
	    for (int j = 0; j < width; j++) {
		map[i][j] = line.charAt(j);
	    }
	}
	reader.close();
	return map;
    }
    
}
